<%--

<!------------------------------------------------------------------------------
 - Copyright 2006 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   PROJECT_PARAM
 - AUTHOR           :   Victor Zheng 
 - DATE CREATE      :   2006/02/01
 - DESCRIPTION      :   a PAGE-EDIT CONTENT JSP file for the function, PROJECT_PARAM
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2006/02/01   Victor Zheng    1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page  import="com.erp.app.admin.projParam.web.ProjectParamAction" %>
<%@ page  import="com.erp.app.admin.projParam.web.ProjectParamRow" %>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="projectParamForm" scope="session" type="com.erp.app.admin.projParam.web.ProjectParamForm" />

<%
ArrayList projectParamList = projectParamForm.getMultiRows();
pageContext.setAttribute("projectParamList", projectParamList);
rowReadOnly = false;
TableSchema ts = projectParamForm.getTs();
%>

<script language="javascript">

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}
		%>
	}

</script>

<body onLoad="javascript:doLoad();autofill_init();">
<html:form action="/projectParam">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>
<html:hidden property="deleteIdx"/>

<table class="table_top">

<tr>
	<td>
		<chtml:button form="projectParamForm" pageEvent="<%=ProjectParamAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="projectParamForm" pageEvent="<%=ProjectParamAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="projectParamForm" pageEvent="<%=ProjectParamAction.ACTION_CLEAR%>"
			styleClass="button1"/>
		<chtml:button form="projectParamForm" pageEvent="<%=ProjectParamAction.ACTION_SAVE%>"
			styleClass="button1"/>
		<chtml:button form="projectParamForm" pageEvent="<%=ProjectParamAction.ACTION_REFRESH%>"
			styleClass="button1"/>
	</td>
</tr>

<tr>
	<td>

		<table class="table_crit">

		<tr class="col_label"> 
			<td class="col_label">&nbsp;</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_FROM");
				%>
				<%=webLabel%>
			</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_TO");
				%>
				<%=webLabel%>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_PRJ_PARAM_ID");
			%>
			<td class="col_label">
			*<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamIdFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamIdTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_PRJ_PARAM_VAL");
			%>
			<td class="col_label">
				<bean:message key="label.general.mandatory.field"/>
				<span class="mandatory_label"><%=webLabel%></span>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamValFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamValTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_PRJ_PARAM_DESC");
			%>
			<td class="col_label">
				<bean:message key="label.general.mandatory.field"/>
				<span class="mandatory_label"><%=webLabel%></span>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamDescFr" styleClass="textbox1" maxlength="<%=srchColLongSize%>" size="<%=srchDisplayLongSize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchPrjParamDescTo" styleClass="textbox1" maxlength="<%=srchColLongSize%>" size="<%=srchDisplayLongSize%>"/>
			</td>
		</tr>
		</table>

	</td>
</tr>

<tr>
	<td><font color='red'><html:errors/></font></td>
</tr>

<tr>
	<td class="grid_page">
	<%if(projectParamForm.getTotalPage() == 0 ) { %>
		&nbsp;
	<%} else { %>
		<input type="button" value="Go" class="button1" onClick="javascript:doSubmit('<%=projectParamForm.ACTION_SCROLL_TO%>');" >
		Page
		<html:text property="scrollTo" styleClass="textbox1" readonly="<%=rowReadOnly%>" maxlength="4" size="4" value="<%=String.valueOf(projectParamForm.getCurrentPage())%>"/>
		of <%=projectParamForm.getTotalPage()%>
	<%} %>
		<input type="button" value="|&lt;&lt;" class="button1" onClick="javascript:doSubmit('<%=projectParamForm.ACTION_SCROLL_TO_FIRST_PAGE%>');" <%=projectParamForm.getSidx() == 0 ? "disabled" : ""%>>
		<input type="button" value="&lt;&lt;" class="button1" onClick="javascript:doSubmit('<%=projectParamForm.ACTION_SCROLL_LEFT%>');" <%=projectParamForm.getSidx() == 0 ? "disabled" : ""%>>
		<input type="button" value="&gt;&gt;" class="button1" onClick="javascript:doSubmit('<%=projectParamForm.ACTION_SCROLL_RIGHT%>');" <%=projectParamForm.getSidx() < Integer.parseInt(projectParamForm.getLastPageSidx()) ? "" : "disabled"%>>
		<input type="button" value="&gt;&gt|" class="button1" onClick="javascript:doSubmit('<%=projectParamForm.ACTION_SCROLL_TO_LAST_PAGE%>');" <%=projectParamForm.getSidx() < Integer.parseInt(projectParamForm.getLastPageSidx()) ? "" : "disabled"%>>
	</td>
</tr>

</table>


<table class="table_grid">

	<tr class="grid_header">		
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_PRJ_PARAM_ID");
		%>
		<td class="grid_header_col" nowrap>
				<bean:message key="label.general.mandatory.field"/>
				<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_PRJ_PARAM_VAL");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
		<%
			webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_PRJ_PARAM_DESC");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
	</tr>

	<logic:iterate id="projectParamRow" name="projectParamList" indexId="idx" length="<%=String.valueOf(ProjectConstants.MAX_DISPLAY)%>" offset="<%=String.valueOf(projectParamForm.getSidx())%>">

	<%
		ProjectParamRow row = (ProjectParamRow) projectParamRow;
	%>

	<% if(row != null) {%>

	<tr <%=(idx.intValue()%2 == 0)? "class='grid_result1'": "class='grid_result2'"%>>		
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_PRJ_PARAM_ID"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_PRJ_PARAM_ID"));
			%>
			<logic:equal name="projectParamRow" property="rowMode" value="<%=ProjectConstants.ROW_MODE_CREATE%>">
				<html:text property="prjParamId" styleClass="textbox1" readonly="<%=rowReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getPrjParamId())%>"/>
			</logic:equal>
			<logic:notEqual name="projectParamRow" property="rowMode" value="<%=ProjectConstants.ROW_MODE_CREATE%>">
				<bean:write name="projectParamRow" property="prjParamId" filter="true"/>
				<html:hidden property="prjParamId" value="<%=CommonUtil.nullToString(row.getPrjParamId())%>"/>
			</logic:notEqual>
		</td>
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_PRJ_PARAM_VAL"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_PRJ_PARAM_VAL"));
			%>
			<html:text property="prjParamVal" styleClass="textbox1" readonly="<%=rowReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getPrjParamVal())%>"/>
		</td>
		<td nowrap>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_GRID_PRJ_PARAM_DESC"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_GRID_PRJ_PARAM_DESC"));
			%>
			<html:text property="prjParamDesc" styleClass="textbox1" readonly="<%=rowReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(row.getPrjParamDesc())%>"/>
		</td>
	</tr>

	<% } // end if(row != null) %>

	<html:hidden property="idx" value="<%=row.getIdx()%>" />
	<html:hidden property="rowMode"  value="<%=row.getRowMode()%>"/>

	</logic:iterate>

</table>

</html:form>
